package com.wyh.onlyoffice.utils;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.Feature;
import com.wyh.onlyoffice.dto.Change;
import com.wyh.onlyoffice.dto.History;

import java.util.List;

public class JsonUtils {
    public static void main(String[] args) {
        String str = "{\"serverVersion\":\"6.4.2\",\"changes\":[{\"created\":\"2022-07-10 09:22:40\",\"user\":{\"name\":\"张三\",\"id\":\"1001\"}}]}";

        History history = JSON.parseObject(str, History.class, Feature.AllowArbitraryCommas);
        List<Change> changes = history.getChanges();
        for (Change item : changes) {
            System.out.println(item);
        }
        System.out.println(history);
    }
}
